﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="orderCardAdd.aspx.cs" Inherits="WebSite.admin.order.orderCardAdd" %>
<%@ Register src="../../Controls/AddressArea.ascx" tagname="AddressArea" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 
    <html xmlns="http://www.w3.org/1999/xhtml">

   <head id="Head1" runat="server">
    <title>万里通后台管理系统</title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />

     <script language="javascript" type="text/javascript">

         function SetNum(id) {

             var oNum = document.getElementById(id);
             if (!isNaN(oNum.value)) {
                 if (oNum.value < 0) {
                     oNum.value = 1;
                 }
             }
             oNum.value = parseInt(oNum.value);
         }

         function checkForm() {
             //  alert('<%=txtUserName.ClientID %>');
             var userName = document.getElementById('<%=txtUserName.ClientID %>');
             //alert(userName.value);
             var tel = document.getElementById('<%= txtTel.ClientID %>');
             var phone = document.getElementById('<%= txtPhone.ClientID %>'); ;
             var address = document.getElementById('<%= txtAddress.ClientID %>');
             if (userName.value == "") {
                 alert('收件人不能为空!');
                 userName.focus();
                 return false;
             } else if (tel.value == "" && phone.value == "") {
                 alert('手机与电话至少填一项！');
                 tel.focus();
                 return false;
             } else if (address.value == "") {
                 alert("地址不能为空!");
                 address.focus();
                 return false;
             }
         }
   </script>

   <style type="text/css">
      .HiddRow
      {
          visibility : hidden;
          }
       .box
       {}
     
   </style>
</head>

<body  bgcolor="#F1F4F7">
    <form id="form1" runat="server">
    <div style="padding-left:10px">
    <br />
  <table width="90%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td> 
       <asp:ImageButton ID="ibtnNewOrder" ImageUrl="../images/btnAddnewOrder.gif" runat="server" OnClick="ibtnNewOrder_Click" />  
            &nbsp;&nbsp; 
    <asp:DropDownList  ID="ddlNoComplateOrder" runat="server"  Visible="false"
            onselectedindexchanged="ddlNoComplateOrder_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
      订单编号：<asp:Label ID="lblOrderCode" ForeColor="Red" runat="server" Text=""></asp:Label>
     </td>
    </tr>
    <tr>
    <td>卡号：
    <asp:TextBox ID="txtCardCode" runat="server"></asp:TextBox>
   密码：
    <asp:TextBox ID="txtCardPassword" runat="server" TextMode="Password"></asp:TextBox>
             <asp:ImageButton ID="ibtnAdd" ImageUrl="../images/button05.gif" runat="server" OnClick="ibtnAdd_Click" /> 
             &nbsp; 选取要删除的卡号：<asp:DropDownList  ID="ddlCards" 
            runat="server" 
            onselectedindexchanged="ddlNoComplateOrder_SelectedIndexChanged" 
            AutoPostBack="true"></asp:DropDownList>

            <asp:ImageButton ID="ibtnDelete" ImageUrl="../images/button06.gif" runat="server" OnClick="ibtnDelete_Click" />
 </td> </tr>
    <tr> <td>
        <asp:Label ID="lblCardDescription" ForeColor="red"  runat="server"></asp:Label>
        <br />
        <asp:Label ID="lblCardInfo" ForeColor="red"  runat="server"></asp:Label>
        </td> </tr>
    <tr><td>
        <asp:RadioButtonList ID="rbtlProfessionList" runat="server" AutoPostBack="True" 
            onselectedindexchanged="rbtlProfessionList_SelectedIndexChanged">
        </asp:RadioButtonList>
        </td>   </tr>
    <tr><td>
        <asp:DropDownList ID="ddlProductList" runat="server">
        </asp:DropDownList>数量
        <asp:TextBox ID="txtNum" runat="server" Width="56px"></asp:TextBox>
           <asp:ImageButton ID="ibtnAddProduct" ImageUrl="../images/button05.gif" runat="server" OnClick="ibtnAddProdut_Click" /> 
        </td>  
   </tr>
    <tr><td> <strong>已添加的产品</strong> </td></tr>
    <tr> <td>
   <asp:GridView ID="GridView1" runat="server" Width="98%" CellPadding="4" 
            ForeColor="#333333" DataKeyNames="id" AutoGenerateColumns="False" 
            AllowPaging="false" pagesize="100" BorderStyle="Solid" BorderWidth="1px" 
      ShowFooter="false" EmptyDataText="没有数据记录！！" AllowSorting="True" 
            onrowcommand="GridView1_RowCommand" >
        <Columns>
        <asp:HyperLinkField DataNavigateUrlFields="id"  DataNavigateUrlFormatString="orders.aspx?oid={0}" HeaderText="产品号" DataTextField="id"  ItemStyle-Width="100px"/>       
          <asp:TemplateField  HeaderText="产品名称">
           <ItemStyle VerticalAlign="Middle"  />
             <ItemTemplate>
             <a href='/cn/goods.aspx?pid=<%#Eval("id")%>' target='_blank'>
            <%# Eval("goodsName")%></a> 
             </ItemTemplate>
        </asp:TemplateField>
          <asp:TemplateField  HeaderText="专区类别">
           <ItemStyle VerticalAlign="Middle" Width="100px"  />
             <ItemTemplate>
             <%#Eval("professionAreaTypeName")%>
             </ItemTemplate>
        </asp:TemplateField>
          <asp:TemplateField  HeaderText="数量">
           <ItemStyle  HorizontalAlign="Center"  Width="50px"  />
             <ItemTemplate>
             <asp:TextBox ID="txtNum" runat="server"  onMouseOut="SetNum(this.id)" Enabled="false" Text='<%#Eval("ProdNumber")%>'   Width="30px"></asp:TextBox>
              <asp:Label ID="lblProfessionTypeId" runat="server" Width="0" ForeColor="#ffffff" Text='<%#Eval("professionType")%>'  ></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
             <asp:TemplateField  HeaderText="价格">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblPrice" runat="server" Text='<%#Eval("ProdPrice")%>' Width="30px"></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
            <asp:TemplateField  HeaderText="总价">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblAmount" runat="server" Text='<%#Eval("SumPrice")%>'  ></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField  HeaderText="操作" ItemStyle-Width="120px" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
             <asp:LinkButton id="lbtEdit" Text="编辑" CommandName="edi"  CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton>
             &nbsp; 
          <asp:LinkButton id="lbtSave" Text="保存" CommandName="sav" Visible="false" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton> 
            &nbsp;
             <asp:LinkButton id="lbtCancel" Text="取消" CommandName="can" Visible="false" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton> 
             &nbsp;
              <asp:LinkButton id="lblDelete" Text="删除"  OnClientClick="return confirm('确认要删除吗？');" CommandName="del" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton>  
             </ItemTemplate>
        </asp:TemplateField>
        </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
             <PagerSettings Visible="False" />
    </asp:GridView>
    </td></tr>
    <tr><td><strong>送货地址</strong></td></tr>
    <tr><td>
    <table width="95%" border="0" cellpadding="0" cellspacing="1" >
             <tr>
		       <td height="25" align="right">收件人：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtUserName" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>
                   *</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >联系电话：</td>
		       <td align="left">　
	           <asp:TextBox ID="txtTel" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>
                   &nbsp;
                   电话和手机至少填一项</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >手 机：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtPhone" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox></td>
	        </tr>
		     <tr style="display:none">
		       <td height="25" align="right" >邮 编：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtPost" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>*</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >地 址：</td>
		       <td align="left" >　
                   <uc1:AddressArea ID="AddressArea1" runat="server" />
	           <asp:TextBox ID="txtAddress" CssClass="box" runat="server" 
                       maxlength="200" Width="300px"></asp:TextBox>*</td>
	        </tr>
		     <tr>
		       <td height="25" align="right">送货日期：</td>
		       <td align="left" >　
	            <asp:TextBox ID="txtSendDate" CssClass="box"  style="behavior:url('../../LWDP.HTC'); width: 80px;" runat="server"
                        ></asp:TextBox></td>
	        </tr> <tr>
		       <td height="25" align="right" >备注：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtRemark" CssClass="box" runat="server" MaxLength="300"
                       Width="418px"></asp:TextBox>*</td>
	        </tr> 
	      </table>
          </td> </tr></table></div>
    <div align="center">
      <asp:ImageButton ID="ibtnSubmit" ImageUrl="../images/btnSubmit.gif" runat="server" OnClientClick="return checkForm();" OnClick="ibtnSubmit_Click" />
    </div>
    </form>
</body>
</html>
